package day04;

import java.util.Arrays;

public class Shuffle1 {
    public static void main(String[] args) {
        int[] a = new int[]{1, 3, 5, 7, 9, 2, 4, 6, 8, 0};
        int n = a.length;
        for (int i = 0; i < n; i++) {
            int j = (int) (Math.random() * (n-i))+i;//[i,n-1]一个随机数
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
        System.out.println(Arrays.toString(a));
    }
}
